import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '产品物料类型名称',
    align: 'left',
    dataIndex: 'name'
   },
   {
    title: '产品物料类型编码',
    align: 'center',
    dataIndex: 'code'
   },
   {
    title: '产品物料标识',
    align: 'center',
    dataIndex: 'itemOrProduct_dictText'
   },
   {
    title: '排列顺序',
    align: 'center',
    dataIndex: 'orderNum'
   },
   {
    title: '是否启用',
    align: 'center',
    dataIndex: 'enableFlag_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '产品物料类型名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '产品物料类型编码',
    field: 'code',
    component: 'Input',
  },
  {
    label: '产品物料标识',
    field: 'itemOrProduct',
    defaultValue: "ITEM",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"item_or_product",
        type: "radio"
     },
  },
  {
    label: '排列顺序',
    field: 'orderNum',
    component: 'InputNumber',
  },
  {
    label: '是否启用',
    field: 'enableFlag',
    defaultValue: "Y",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"enable_flag",
        type: "radio"
     },
  },
  {
    label: '父级节点',
    field: 'pid',
    component: 'JTreeSelect',
    componentProps: {
      dict: "wm_item_type,name,id",
      pidField: "pid",
      pidValue: "0",
      hasChildField: "has_child",
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '产品物料类型名称',order: 0,view: 'text', type: 'string',},
  code: {title: '产品物料类型编码',order: 1,view: 'text', type: 'string',},
  itemOrProduct: {title: '产品物料标识',order: 2,view: 'radio', type: 'string',dictCode: 'item_or_product',},
  orderNum: {title: '排列顺序',order: 3,view: 'number', type: 'number',},
  enableFlag: {title: '是否启用',order: 4,view: 'radio', type: 'string',dictCode: 'enable_flag',},
};


/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
